package com.example.peibei.ui.adapter;

import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.dingtao.common.bean.SystemMessage;
import com.example.peibei.R;

import java.util.List;

public class DynamicMessageAdapter extends BaseQuickAdapter<SystemMessage.RecordsDTO, BaseViewHolder> {
    public DynamicMessageAdapter(@Nullable List<SystemMessage.RecordsDTO> data) {
        super(R.layout.item_dynamic_message, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, SystemMessage.RecordsDTO item) {
        ImageView head = helper.getView(R.id.iv_head);
        Glide.with(getContext()).load(item.getImgUrl()).apply(RequestOptions.bitmapTransform(new CircleCrop())).into(head);
        helper.setText(R.id.tv_content,item.getContent()).setText(R.id.tv_time,item.getDate()).setText(R.id.tv_name,item.getNickName()).setText(R.id.tv_time,item.getDate())
        .setText(R.id.tv_dec,item.getSubject());

    }
}
